import { AxiosResponse } from "axios";
import service from "@/api";

export type RegionItem = {
  code: number;
  fullname: string;
  latitude: number;
  level: "province" | "city" | "district";
  longitude: number;
  name: string;
  pcode: number | null;
  pname: string | null;
  children?: RegionItem[];
};

/**
 * 获取区域信息
 */
export function queryRegionInfo(): Promise<AxiosResponse<RegionItem[]>> {
  let url = "/org/JxudpRegionInfoService/queryList";
  return service.get(url);
}
